home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / rexx / rmh.lha / rmh / examples / getfdate.rexx < prev    next >
OS/2 REXX Batch file  |  1999-04-23  |  975b  |  30 lines

  1. /* GetFileDate() and date2GMT() example */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4.  
  5. if ~RMH_ReadArgs("FILE/A") then do
  6.     call printfault(ioerr(),programname("NOEXT"))
  7.     exit
  8. end
  9.  
  10. inetDate="%m %w %d %Y %H:%M:%S GMT"
  11.  
  12. if GetFileDate(parm.0.value,"FD") then do
  13.         if date2gmt("FD") then
  14.             say "GMT file date:" translateDate(formatdate("FD",inetDate))
  15.         else do
  16.             say "Can't find ENV:TZ"
  17.             say "Locale file date:" translateDate(formatdate("FD",inetDate))
  18.         end
  19. end
  20. else say "Can't get date of file '"parm.0.value"'"
  21. exit
  22. /***************************************************************************/
  23. translateDate: procedure
  24.     d.0="Sun";d.1="Mon";d.2="Tue";d.3="Wed";d.4="Thu";d.5="Fri";d.6="Sat"
  25.     m.1="Jan";m.2="Feb";m.3="Mar";m.4="Apr";m.5="May";m.6="Jun";m.7="Jul";m.8="Aug";m.9="Sep";m.10="Oct";m.11="Nov";m.12="Dec"
  26.     parse arg i j rest
  27.     i=i%1
  28.     return d.j"," m.i || rest
  29. /***************************************************************************/
  30.